/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2012-01-01    aozima       first implementation.
 */

#ifndef gd32F20X_40X_SPI_H_INCLUDED
#define gd32F20X_40X_SPI_H_INCLUDED
#include <rtthread.h>

#define SPI0_BUS_NAME			("spi0")
#define SPI1_BUS_NAME			("spi1")
#define SPI2_BUS_NAME			("spi2")
#define SPI3_BUS_NAME			("spi3")
#define SPI4_BUS_NAME			("spi4")

#ifdef RT_USING_PIN
rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, rt_base_t pin);
#else
rt_err_t rt_hw_spi_device_attach(const char *bus_name, const char *device_name, uint32_t cs_gpiox, uint32_t cs_gpio_pin);
#endif	/* RT_USING_PIN */

#endif // gd32F20X_40X_SPI_H_INCLUDED
